#include <iostream>
using namespace std;

#include<cstring>

#include <signal.h>
#include <unistd.h>
#include <sys/types.h>

//自己实现kill指令

void UserMan() //手册提示
{
    cout<<"mykill UserMan:"<<endl;
    cout<<"\t\t./mykill [信号] [进程pid]"<<endl;
    cout<<endl;
}

int main(int argc,char* argv[])
{
    if(argc != 3)
    {
        UserMan();
        exit(EOF);
    }

    int pid = atoi(argv[2]);
    int k = atoi(argv[1]);
    int n = kill(pid,k);
    if(n == -1)
    {
        cout<<"kill lapse!"<< errno <<strerror(errno)<<endl;
        exit(EOF);
    }
    return 0;
}